![]() |
PATH![]() |
![]() ![]() |
Sets a window's foreground color to a theme-compliant color.
pascal OSStatus SetThemeTextColorForWindow (
WindowPtr window,
Boolean isActive,
SInt16 depth,
Boolean isColorDev);
The SetThemeTextColorForWindow function determines whether the specified window has a theme brush associated with its background and, if so, applies the correct foreground color given the theme brush, the window's activity state, and the current drawing environment. This foreground color is applied to any text drawn after the call to SetThemeTextColorForWindow . Note that SetThemeTextColorForWindow only applies a custom foreground color when the window has a theme brush associated with it or if the window is a Dialog Manager dialog box. If your window is not managed by the Dialog Manager, you must use the function SetThemeWindowBackground to associate a theme brush with the window before calling SetThemeTextColorForWindow .
For example, you can call SetThemeWindowBackground to associate the active alert background theme brush with a window:
SetThemeWindowBackground (myWindow, kThemeBrushAlertBackgroundActive, true)
// ...
SetThemeTextColorForWindow (myWindow, true, 16, true)
Then, when you call SetThemeTextColorForWindow , the result is that the window's foreground color is automatically set to the color appropriate for an active alert in the specified drawing environment. In this case, the foreground color that the Appearance Manager would use is that corresponding to the theme text color constant kThemeTextColorAlertActive .